local zhenxdj = fk.CreateSkill {
    name = "zhenxdj",
}
Fk:loadTranslationTable{
    ["zhenxdj"] = "真·星盾打击",

    [":zhenxdj"] = "出牌阶段限一次，你可以弃置一张装备牌并对一名其他角色造成X点伤害（若你弃置的是<a href=':progoldsheild'>【振金盾牌】</a>，则伤害+1）（X为你已损失的体力值且至多为3），然后本回合内你不能使用【杀】。",
    ["#zhenxdj"] = "真·星盾打击：你可以弃置一张装备牌并对一名其他角色造成X点伤害（若你弃置的是<a href=':progoldsheild'>【振金盾牌】</a>，则伤害+1）<br>（X为你已损失的体力值且至多为3）<br>然后本回合内你不能使用【杀】。",

}

zhenxdj:addEffect("active", {
    prompt = "#zhenxdj",
    min_card_num = 1,
    min_target_num = 1,
    can_use = function(self, player)
        -- 检查区域内是否有振金盾牌
        local has_shield = false
        for _, id in ipairs(player:getCardIds("he")) do
            local card = Fk:getCardById(id)
            if card.type == Card.TypeEquip then
                has_shield = true
            end
        end 
        return has_shield and not player:isNude() and player:usedSkillTimes(zhenxdj.name,Player.HistoryPhase) == 0
    end,
    card_filter = function(self, player, to_select, selected)
        return not player:prohibitDiscard(to_select) and Fk:getCardById(to_select).type == Card.TypeEquip
    end,
    target_filter = function(self, player, to_select, selected, cards)
        return #selected == 0 and to_select ~= player
    end,
    
    on_use = function(self, room, effect)
      local player = effect.from
      local target = effect.tos[1]
      room:throwCard(effect.cards, zhenxdj.name,player,player)
      local num 
      num = player:getLostHp()
      if Fk:getCardById(effect.cards[1]).name == "progoldsheild" then
        num = num + 1
      end
      room:damage{
        from = player,
        to = target,
        damage = num,
        skillName = zhenxdj.name,
      }  
      room:setPlayerMark(player, "zhenxdj_cantslash-turn", 1)
    end,
  })

zhenxdj:addEffect("prohibit", {
    prohibit_use = function(self, player, card)
        return player:getMark("zhenxdj_cantslash-turn") == 1 and card.trueName == "slash"
    end,
})

return zhenxdj 